package test;

public class LSD {
	public static final String alphaNumerics = "0123456789abcdefghijklmn";
	public static final int N = 100;
	public static final int W = 10;
	
	public static void main(String[] args) {
//		String[] strs = genarateArray();
//		
//		sort(strs);
//		
//		for(int i = 0; i < N; i ++)
//		{
//			System.out.println(strs[i]);
//		}
		
		System.out.println("abc".charAt(4));
	}

	public static String[] genarateArray()
	{
		int R = alphaNumerics.length();
		String[] strs = new String[N];
		for(int i = 0; i < N; i ++)
		{
			StringBuffer sb = new StringBuffer();
			for(int j = 0; j < W; j ++)
			{
				sb.append(alphaNumerics.charAt((int)(Math.random() * R)));
			}

			strs[i] = sb.toString();
		}
		
		return strs;
	}
	
	public static void sort(String[] strs)
	{
		String[] aux = new String[N];
		for(int i = W - 1; i >= 0; i --)
		{
			int[] count = new int[Character.MAX_VALUE];

			for(int j = 0; j < N; j ++)
			{
				String str = strs[j];
				count[str.charAt(i)] ++;
			}
			
			for(int j = 0; j < Character.MAX_VALUE; j ++)
			{
				count[j + 1] += count[j];
			}

			for(int j = 0; j < N; j ++)
			{
				String str = strs[j];
				aux[count[str.charAt(i) - 1] ++] = str;
			}
			
			for(int j = 0; j < N; j ++)
			{
				strs[j] = aux[j];
			}
		}
	}
}
